<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>人事管理系统 ——后台管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>
    <link href="fkjava.ico" rel="shortcut icon" type="image/x-icon"/>
    <link href="${pageContext.request.contextPath}/css/css.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-migrate-1.2.1.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.form.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {

            /** 表单提交的校验 */
            $("#btn").click(function () {
                var title = $("#title").val();
                var file = $("#file").val();

                if ($.trim(title).length <= 2) {
                    alert("请输入两个字符以上的标题");
                    return;
                }

                $("#documentForm").submit();
                <%--$.post("${pageContext.request.contextPath}/document/updateDocument", $("#documentForm").serialize(),--%>
                <%--    function (data) {--%>
				<%--		if (data == "OK"){--%>
				<%--			alert("修改成功！")--%>
				<%--			window.location.href = "${pageContext.request.contextPath}/document/findDocument?pageIndex=${pageIndex}&title=${title}"--%>
				<%--		}else {--%>
				<%--			alert("修改失败！")--%>
				<%--			window.location.reload()--%>
				<%--		}--%>
                <%--    });--%>
            })
        });


    </script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="10"></td>
    </tr>
    <tr>
        <td width="15" height="32"><img src="${pageContext.request.contextPath}/images/main_locleft.gif" width="15"
                                        height="32"></td>
        <td class="main_locbg font2"><img src="${pageContext.request.contextPath}/images/pointer.gif">&nbsp;&nbsp;&nbsp;当前位置：文档管理
            &gt; 修改文档
        </td>
        <td width="15" height="32"><img src="${pageContext.request.contextPath}/images/main_locright.gif" width="15"
                                        height="32"></td>
    </tr>
</table>

<table width="100%" height="90%" border="0" cellpadding="10" cellspacing="0" class="main_tabbor">
    <tr valign="top">
        <td>

            <form id="documentForm" name="documentForm" action="${pageContext.request.contextPath}/document/updateDocument" enctype="multipart/form-data" method="post">
                <!-- 隐藏表单，flag表示添加标记 -->
                <input type="hidden" name="flag" value="2">
                <input type="hidden" name="pageIndex" value="${pageIndex}">
                <input type="hidden" name="msg" value="${msg}">
                <input type="hidden" name="id" value="${document.id }">
                <table width="100%" border="0" cellpadding="0" cellspacing="10" class="main_tab">

                    <tr>
                        <td class="font3 fftd">


                            文档标题：<input type="text" name="title" size="30" id="title" value="${document.title }"/></td>
                    </tr>
                    <tr>
                        <td class="main_tdbor"></td>
                    </tr>


                    <tr>
                        <td class="font3 fftd">文档描述：<br/>
                            <textarea name="remark" cols="88" rows="11" id="content">${document.remark }</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="main_tdbor"></td>
                    </tr>

                    <tr>
                        <td class="font3 fftd">文档：<br/>
                            <input type="file" name="multipartFile" id="file" size="30"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="main_tdbor"></td>
                    </tr>


                    <tr>
                        <td class="font3 fftd">
                            <input type="button" id="btn" value="确定">
                            <input type="reset" value="重置">
                        </td>
                    </tr>
                    <tr>
                        <td class="main_tdbor"></td>
                    </tr>


                </table>
            </form>
        </td>
    </tr>
</table>
<div style="height:10px;"></div>
</body>
</html>